The Recommend widgets are part of InstantSearch.js. Learn how you can upgrade from Recommend JS.
instantsearch.js
and algoliasearch
packages to your project,
and remove the @algolia/recommend
and @algolia/recommend-js
packages:
trendingFacets
function is no longer available.
To replace it, see widgets.instantsearch
component.
Pass the API client and index name to the instantsearch
widget:
Recommend JS | InstantSearch.js | Changes |
---|---|---|
frequentlyBoughtTogether | frequently-bought-together | Prop changes |
relatedProducts | related-products | Prop changes |
trendingItems | trending-items | Prop changes |
trendingFacets | Removed | Alternative |
lookingSimilar | looking-similar | Prop changes |
frequentlyBoughtTogether
recommendClient
and indexName
to instantsearch
frequently-bought-together
widget no longer needs recommendClient
and indexName
props.
Instead, pass a searchClient
and the ìndexName
to instantsearch
.
view
with the layout
template or the connectFrequentlyBoughtTogether
connectorfrequently-bought-together
widget no longer provides a view
prop.
To fully customize the UI, use either the layout
template or the frequently-bought-together
connector instead.
templates
frequently-bought-together
widget uses templates to customize specific parts of its UI.
Recommend JS | InstantSearch.js |
---|---|
headerComponent | header |
itemComponent | item |
fallbackComponent | empty |
translations
with templates
frequently-bought-together
widget uses templates to provide translations to the header.
maxRecommendations
with limit
limit
prop replaces the maxRecommendations
prop.
environment
environment
prop is no longer needed.
classNames
with cssClasses
cssClasses
prop replaces the classNames
prop.
relatedProducts
recommendClient
and indexName
to instantsearch
related-products
widget no longer needs recommendClient
and indexName
props.
Instead, pass a searchChlient
and the ìndexName
to instantsearch
.
view
with the layout
template or the connectRelatedProducts
connectorrelated-products
widget no longer provides a view
prop.
To fully customize the UI, use either the layout
template or the related-products
connector instead.
templates
related-products
widget uses templates to customize specific parts of its UI.
Recommend JS | InstantSearch.js |
---|---|
headerComponent | header |
itemComponent | item |
fallbackComponent | empty |
translations
with templates
related-products
widget uses templates to provide translations to the header.
maxRecommendations
with limit
limit
prop replaces the maxRecommendations
prop.
environment
environment
prop is no longer needed.
classNames
with cssClasses
cssClasses
prop replaces the classNames
prop.
trendingItems
recommendClient
and indexName
to instantsearch
trending-items
widget no longer needs recommendClient
and indexName
props.
Instead, pass a searchClient
and the ìndexName
to instantsearch
.
view
with the layout
template or the connectTrendingItems
connectortrending-items
widget no longer provides a view
prop.
To fully customize the UI, use either the layout
template or the trending-items
connector instead.
templates
trending-items
widget uses templates to customize specific parts of its UI.
Recommend JS | InstantSearch.js |
---|---|
headerComponent | header |
itemComponent | item |
fallbackComponent | empty |
translations
with templates
trending-items
widget uses templates to provide translations to the header.
maxRecommendations
with limit
limit
prop replaces the maxRecommendations
prop.
environment
environment
prop is no longer needed.
classNames
with cssClasses
cssClasses
prop replaces the classNames
prop.
trendingFacets
trendingFacets
.
If you need it, use the trendingFacets
function
from the deprecated Recommend JS library.
lookingSimilar
recommendClient
and indexName
to instantsearch
looking-similar
widget no longer needs recommendClient
and indexName
props.
Instead, pass a searchChlient
and the ìndexName
to instantsearch
.
view
with the layout
template or the connectLookingSimilar
connectorlooking-similar
widget no longer provides a view
prop.
To fully customize the UI, use either the layout
template or the looking-similar
connector instead.
templates
looking-similar
widget uses templates to customize specific parts of its UI.
Recommend JS | InstantSearch.js |
---|---|
headerComponent | header |
itemComponent | item |
fallbackComponent | empty |
translations
with templates
looking-similar
widget uses templates to provide translations to the header.
maxRecommendations
with limit
limit
prop replaces the maxRecommendations
prop.
environment
environment
prop is no longer needed.
classNames
with cssClasses
classNames
keys have changed and are defined through the cssClasses
prop.
horizontalSlider
horizontalSlider
view is now available in InstantSearch.js as a carousel
template.
For carousel options, check the API reference:
frequentlyBoughtTogether
relatedProducts
lookingSimilar